package com.superteam.mac.dao;

public class StateRecDAO extends BaseDAO {
	//机床数： 210 开机数： 180 待机数： 20 工作数： 160 
	public int findMachineStautTotal()
	{
		//String sql = "select count(MachineCode) from tbStateRec group by MachineCode";
		String sql = "select count(*) from tbMachineRec";
		System.out.println(sql);
		try
		{
			return this.getJdbcTemplate().queryForInt(sql);
		}catch(Exception e)
		{
			//e.printStackTrace();
			return 0;
		}
	}
	public int findMachineStautByStautName(String stautName)
	{
		String sql = "select  count(MachineCode) from tbStateRec where StateType = '"+stautName+"' group by MachineCode";
		try
		{
			return this.getJdbcTemplate().queryForInt(sql);
		}catch(Exception e)
		{
			//e.printStackTrace();
			return 0;
		}
	}
	
}
